package com.liuyou.weather3;

public class WebsideObserver {
    protected double temperature;
    protected double pressure;
    protected double humidity;

    public WebsideObserver() {
    }

    public WebsideObserver(double temperature, double pressure, double humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
    }

    @Override
    public String toString() {
        return "WebsideObserver{" +
                "temperature=" + temperature +
                ", pressure=" + pressure +
                ", humidity=" + humidity +
                '}';
    }

    public void update(double temperature, double pressure, double humidity) {
        this.temperature = temperature;
        this.pressure = pressure;
        this.humidity = humidity;
        System.out.println(toString());
    }
}
